import { Router } from "express";
import { Routes } from "../interfaces/routes.interface";
import UserController from "../controllers/user.controller";
// implements 关键字用于实现接口
// 这里表示 Route 类需要实现 Routes 接口中定义的所有方法和属性
class Route implements Routes {
    public router = Router();
    public UserController = new UserController();
    constructor() {
        this.initializeRoutes();
    }
    private whiteActionList = ['Login', 'Register', 'GetUserInfo'];
    public initializeRoutes() {
        
        this.router.post('/register', this.UserController.register)
        this.router.post('/login', this.UserController.login)
        this.router.get('/userlist', this.UserController.userlist)
        this.router.get('/user/detail', this.UserController.userDetail)
    }
}
export default Route;